#ifndef REALTIMEPOSITIONWINDOW_H
#define REALTIMEPOSITIONWINDOW_H

#include <QMainWindow>
#include <QTcpServer>
#include <QTcpSocket>
#include <QGraphicsScene>
#include <QList>
#include <QPointF>

QT_BEGIN_NAMESPACE
namespace Ui { class RealtimePositionWindow; }
QT_END_NAMESPACE

class RealtimePositionWindow : public QMainWindow {
    Q_OBJECT

public:
    explicit RealtimePositionWindow(QWidget *parent = nullptr);
    ~RealtimePositionWindow();

private slots:
    void onNewConnection();
    void onReadPosition();
    void onConnectButtonClicked();  // 新增连接按钮的槽函数

private:
    Ui::RealtimePositionWindow *ui;
    QTcpServer* tcpServer;
    QGraphicsScene* positionScene;  // 实时位置显示场景
    QList<QPointF> trackPoints;  // 用于存储轨迹点
    QPointF initialPoint;  // 初始点
};

#endif // REALTIMEPOSITIONWINDOW_H
